home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Milan_1991 / Devcon91.4 / AppShell / Examples / ILBMer / test.ilbmer < prev   
Encoding:
Text File  |  1992-09-01  |  950 b   |  55 lines

  1. /* test.ilbmer
  2.  * Little macro to test ARexx error processing
  3.  * Written by David N. Junod
  4.  *
  5.  */
  6.  
  7. OPTIONS RESULTS
  8. OPTIONS FAILAT 10
  9. PARSE ARG in_file out_file
  10.  
  11. Main:
  12.  
  13.     /* I'm talking to you! */
  14.     SAY ADDRESS
  15.     ADDRESS ILBMER.1
  16.  
  17.     /* Open the input file. If no name was provided, then ILBMer will
  18.      * open a file requester */
  19.     "Open" in_file
  20.  
  21.     /* Successful? */
  22.     IF RC = 0 THEN DO
  23.  
  24.     /* Indicate mode */
  25.     "SetMode Image"
  26.  
  27.     /* Save the brush as C source. If no name was provided, then
  28.      * ILBMer will open a file requester. */
  29.     "SaveAs" out_file
  30.  
  31.     /* Error? */
  32.     IF RC > 0 THEN CALL ShowError()
  33.  
  34.     /* Free the memory that it used */
  35.     "Clear"
  36.  
  37.     END
  38.  
  39.     ELSE CALL ShowError()
  40.  
  41.  
  42. RETURN
  43. /* End of main routine */
  44.  
  45. ShowError: PROCEDURE EXPOSE ILBMER.
  46.  
  47.     /* Get the text associated with the error */
  48.     "Why"
  49.  
  50.     /* Display the error number and text */
  51.     SAY "Error #:" ILBMER.LastError||"," RESULT
  52.  
  53. RETURN
  54. /* End of ShowError() */
  55.